<?php
include_once('common/header.php');	
if($AppUI->id <= 0 || !isset($_SERVER['HTTP_REFERER'])) {	
	Vfriend_Function::setError($arrError[11]);
	Vfriend_Function::redirect(HOST_VFRIEND);
}
$strRefer		= isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : HOST_VFRIEND;
$arrParam		= $objRequest->getParams();
$intUserId		= isset($arrParam['puserid']) ? Vfriend_Function::base64D($arrParam['puserid']) : 0; 
$intId			= isset($arrParam['pid']) ? Vfriend_Function::base64D($arrParam['pid']) : 0; 
$intType		= isset($arrParam['ptype']) ? Vfriend_Function::base64D($arrParam['ptype']) : 0; 
$strToken		= isset($arrParam['ptoken']) ? $arrParam['ptoken'] : '';
$arrCate		= isset($arrParam['pcate']) ? $arrParam['pcate'] : null;
$intCate		= Vfriend_Function::convertArrToInt($arrCate);
$strTok			= $intId . '_' . $intType;
$strSession	 	= Vfriend_Function::getSecret($strTok, SE_AJAX_REPORT);
$intError		= 0;
if($intError == 0 && Vfriend_Function::isValidLink($strRefer) && $strToken != '' && $strSession != '' && $strToken == $strSession && $intCate) {
	Vfriend_Function::deleteSecret($strTok, SE_AJAX_REPORT);
	$objURequest	= new URequest();
	if($intUserId > 0) $intId = $intUserId;
	$objURequest->addReport($AppUI->id,$intCate,$intType,$intId);
	Vfriend_Function::setMsg($arrMessage[6]);	
} else {
	$intError = 11;
}
if($intError > 0) {
	Vfriend_Function::setError($arrError[$intError]);
}
Vfriend_Function::redirect($strRefer);
?>